package com.继承.基础;
class Animal{
    String name;
    static{
        System.out.println("animal的静态代码块");
    }
    {
        System.out.println("animal的实例代码块");
    }
    Animal(String name){
        this.name = name;
        System.out.println(this.name+"构造方法执行");
    }
}
class Dog extends Animal{
    static{
        System.out.println("Dog的静态代码块");
    }
    {
        System.out.println("Dog的实例代码块");
    }
    Dog(String name){
        super(name);
        System.out.println(this.name+"构造方法执行");
    }
}
public class 代码块 {
    public static void main(String[] args) {
        Dog dog1 =new Dog("大黄");
        System.out.println("==============");
        Dog dog2 =new Dog("小黄");
    }
}
